package game.farming.ui;

import game.farming.model.Table;

import java.util.HashMap;
import java.util.Vector;

public class ApplicationBean{
	private HashMap<String, Table> tables;
	
	public static void main(String[] args){
	}
	
	public ApplicationBean(){
		tables = new HashMap<String, Table>();
		tables.put("Test1", null);
		tables.put("Test2", null);
	}
	
	public void createTable(String tableName){
		Table t = new Table(tableName);
		tables.put(tableName, t);
	}
	
	public void addPlayerToTable(String tableName, Player p){
		Table table = tables.get(tableName);
		if( table != null ){
			table.addPlayer( p );
		}
	}

	public HashMap<String, Table> getTables() {
		return tables;
	}

	public void setTables(HashMap<String, Table> tables) {
		this.tables = tables;
	}
	public Vector<String> getTableNames(){
		return new Vector<String>(tables.keySet());
	}
}
